﻿using System;
using System.Collections.Generic;

class DecimalToBinary
{
    static void Main()
    {
        //Exercise 1.
        //Write a program to convert decimal numbers to their binary representation.

        Console.Write("Enter a decimal number: ");
        int number = int.Parse(Console.ReadLine());
                
        List<int> binary = new List<int>();
            
        while (number > 0)
        {
            binary.Add(number % 2);
            number = number / 2;
        }

        //print
        for (int i = binary.Count - 1; i >= 0; i--)
        {
            Console.Write(binary[i]);
        }
        Console.WriteLine();
    }
}

